package com.hbk.controller;

import java.util.*;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.hbk.service.*;
import com.hbk.pojos.*;
import com.hbk.dto.*;


@Controller
@RequestMapping("/api")
public class ${clazzAlias}Controller extends BaseController{
	
	@Resource
	private I${clazzAlias}Service ${clazzAlias?uncap_first}Service;

	<#list methods as method>
	@ResponseBody
	@${method.method}Mapping("${method.uri}")
	public Result ${method.name}(<#if (method.params?size==0)><#else><#if method.method=='Get'>@ModelAttribute<#elseif method.method=='Delete'>@PathVariable<#else>@RequestBody</#if> ${method.paramsStr}</#if>){
		<#if method.result=='void'>
		${clazzAlias?uncap_first}Service.${method.name}(<#if (method.params?size==0)><#else>${method.params[0].var}</#if>);
		return Result.success();
		<#else>
		${method.result} result=${clazzAlias?uncap_first}Service.${method.name}(<#if (method.params?size==0)><#else>${method.params[0].var}</#if>);
		return Result.success(result);
		</#if>
	}
	
	</#list>
	
}